package com.example.administrator.show.photo;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.example.administrator.show.HomeChildFragment;
import com.example.administrator.show.R;


public class WebviewFragment extends HomeChildFragment {
    private View view;
    private WebView objwv;
    // private WebView objwv;

    @Override
    protected View onCreateContentView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        //  return inflater.inflate(R.layout.fragment_home, container, false);

        view = inflater.inflate(R.layout.fragment_webview, container, false);

      //  objwv = (WebView) view.findViewById(R.id.wv);
     //   objwv.loadUrl("http://guocui.vqo.cn/Admin/index.php/Wap/index");
      /*  objwv.setWebViewClient(new WebViewClient(){

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String request) {

                objwv.loadUrl(request);
                return super.shouldOverrideUrlLoading(view, request);
            }
        });
*/

        return view;
    }


    public void  seturl( String  str){


        objwv = (WebView)  view.findViewById(R.id.wv);
        objwv.loadUrl(str);
        objwv.setWebViewClient(new WebViewClient(){

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String request) {

                objwv.loadUrl(request);
                return super.shouldOverrideUrlLoading(view, request);
            }
        });

//        WebSettings settings = objwv.getSettings();
        //settings.setUseWideViewPort(true);
        ///settings.setLoadWithOverviewMode(true);
        ///    settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);


    }



}